package com.bootdo.lvyou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou.dao.XcxConfigDao;
import com.bootdo.lvyou.domain.XcxConfig;
import com.bootdo.lvyou.service.XcxConfigService;



@Service
public class XcxConfigServiceImpl implements XcxConfigService {
	@Autowired
	private XcxConfigDao xcxConfigDao;
	
	@Override
	public XcxConfig get(Long id){
		return xcxConfigDao.get(id);
	}
	
	@Override
	public List<XcxConfig> list(Map<String, Object> map){
		return xcxConfigDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return xcxConfigDao.count(map);
	}
	
	@Override
	public int save(XcxConfig xcxConfig){
	
		if(xcxConfig.getId() != null) {
			return xcxConfigDao.update(xcxConfig);
		}else {
			return xcxConfigDao.save(xcxConfig);
		}		
	
		
	}
	
	@Override
	public int update(XcxConfig xcxConfig){
		return xcxConfigDao.update(xcxConfig);
	}
	
	@Override
	public int remove(Long id){
		return xcxConfigDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return xcxConfigDao.batchRemove(ids);
	}

	@Override
	public XcxConfig getDefalt() {
		return xcxConfigDao.get(1L);
	}
}
